# Contributors: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: team/gnome <ablocorrea@hotmail.com>
pkgname=gnome-calculator
pkgver=46.0
pkgrel=0
pkgdesc="Calculator for solving mathematical equations"
url="https://wiki.gnome.org/Apps/Calculator"
# s390x: doubt anyone would run this on a mainframe
arch="all !s390x"
license="GPL-3.0-or-later"
makedepends="
	glib-dev
	gtksourceview5-dev
	gtk4.0-dev
	itstool
	libadwaita-dev
	libgee-dev
	libsoup3-dev
	libxml2-dev
	meson
	mpc1-dev
	mpfr-dev
	vala
	"
subpackages="$pkgname-devhelp $pkgname-doc $pkgname-lang $pkgname-dev"
source="https://download.gnome.org/sources/gnome-calculator/${pkgver%%.*}/gnome-calculator-$pkgver.tar.xz"

if [ "$CARCH" = armhf ]; then
	options="$options !check" # tests time out on armhf
fi

build() {
	abuild-meson \
		-Db_lto=true \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
b2af034df6c0e94519aef505e960ef3b31f52038b8224d7688d32de8d4b061ac9ee2a127efdce16679ae8863c2fc625476302571db32e9d9859f9800000466c0  gnome-calculator-46.0.tar.xz
"
